package com.guigu.health.dao;

import com.guigu.health.pojo.Role;
import com.guigu.health.pojo.RoleUsers;
import com.guigu.health.pojo.User;
import com.guigu.health.pojo.User_RoleKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @ClassName:UserRoleMapper
 * @Description:用户角色接口持久层
 * @Author:longtao
 * @Date:2021/4/19
 * @Version:1.0
 */
public interface UserRoleMapper {
    /**
     * 根据角色名查找
     *
     * @param name
     * @return
     */
    public List<RoleUsers> queryByName(@Param("name") String name);

    /**
     * 根据角色id查找
     *
     * @param roleID
     * @return
     */
    public List<User> queryUserByID(@Param("roleID") Integer roleID);

    /**
     * 批量删除
     *
     * @param userID
     * @return
     */
    public int batchDeletion(@Param("userID") List<Integer> userID);

    /**
     * 批量修改
     *
     * @param user_roleKeys
     * @return
     */
    public int batchUpdate(@Param("user_roleKeys") List<User_RoleKey> user_roleKeys);

    /**
     * 批量添加
     *
     * @param user_roleKeys
     * @return
     */
    public int batchAdd(@Param("user_roleKeys") List<User_RoleKey> user_roleKeys);



    /**
     * 根据角色id查询用户id
     *
     * @param userID
     * @return
     */
    public List<Integer> getCountID(@Param("userID") Integer userID);

    /**
     * 根据id删除
     * @param id
     * @return
     */
    public Integer delete(Integer id);

}
